package cn.echo.ecc.scheduled;

import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@EnableAsync
public class KillCoursePublishScheduled {

    // 0 0 2 * * ?：真实上线的表达式，每天凌晨两点执行
    @Async
    @Scheduled(cron = "0 0 2 * * ?") // cron表达式
    public void piblish(){
        // 在此方法中查询出当日需要发布的活动，调用发布方法进行发布
        System.out.println("执行线程名称：" + Thread.currentThread().getName());
    }

}
